<template>
  <!-- <div>list vue
    {{this.$route.fullPath}} -- {{this.$route.meta.cfgId}}
  </div> -->
  <search :config="searchcfg" v-if="searchcfg.enable"></search>
  <buttons v-if="buttoncfg.enable" :config="buttoncfg"></buttons>
  <mytable v-if="tablecfg.enable" :config="tablecfg"></mytable>
  <!-- <router-view></router-view> -->
</template>

<script>
import axios from 'axios'
import search from '../components/search.vue'
import buttons from '../components/buttons.vue'
import mytable from '../components/table.vue'
export default {  
  components:{search,buttons,mytable},
  created(){
    let cfgId=this.$route.meta.cfgId
    let url="http://localhost:7788/config?id="+cfgId
    axios.get(url).then(rep=>{
      console.log(rep.data);
      this.searchcfg=rep.data.data.searchs
      this.buttoncfg=rep.data.data.buttons
      this.tablecfg=rep.data.data.fields
    })
  },
  data(){
    let r=this.$route
    // console.log('list.vue',r);
    return {
      searchcfg:{},
      buttoncfg:{},
      tablecfg:{}
    }
  }
}
</script>

<style>

</style>
